import useRequest from "@/api/useRequest"
import {IPage} from "@/interface/modules/system";
export class tagCategoryController {


  static getTagDic(): Promise<any>{
    return useRequest({
      url: "/tag/tagCategory/getTagDic",
      method: "get"
    })
  }

  static listParentCategory(): Promise<any>{
    return useRequest({
      url: "/tag/tagCategory/getParentTagCategory",
      method: "get"
    })
  }

  static listTagCategoryTree(parentId:string): Promise<any>{
    return useRequest({
      url: "/tag/tagCategory/getTagCategoryTree?parentId="+parentId,
      method: "get"
    })
  }

  static listTagTreeByCategoryId(tagId:string): Promise<any>{
    return useRequest({
      url: "/tag/tagCategory/getTagByCategoryId?categoryIds="+tagId,
      method: "get"
    })
  }

  static getTagAttributeList (data:any ,pagination?: IPage): Promise<any>{
    return useRequest({
      url: "/tag/tagAttribute/getTagAttribute",
      method: "post",
      params: pagination,
      data
    })
  }

  static addTagAttribute (data:any): Promise<any>{
    return useRequest({
      url: "/tag/tagAttribute/add",
      method: "post",
      data
    })
  }

  static batchAddTagAttribute (data:any): Promise<any>{
    return useRequest({
      url: "/tag/tagAttribute/batchAdd",
      method: "post",
      data
    })
  }

  static deleteTagAttribute (tagAttributeId:string): Promise<any>{
    return useRequest({
      url: "/tag/tagAttribute/delete/"+tagAttributeId,
      method: "delete"
    })
  }

  static addTagCategory (data:any): Promise<any>{
    return useRequest({
      url: "/tag/tagCategory/add",
      method: "post",
      data
    })
  }

  static deleteTagCategory (tagCategoryId:string): Promise<any>{
    return useRequest({
      url: "/tag/tagCategory/delete/"+tagCategoryId,
      method: "delete"
    })
  }

  static autoCompletion (data:any): Promise<any>{
    return useRequest({
      url: "/tag/tagCategory/autoComplete",
      method: "post",
      data
    })
  }

}
